import 'package:easy_refresh/easy_refresh.dart';
import 'package:get/get.dart';

import 'state.dart';

class HomeController extends GetxController {
  final EasyRefreshController refreshController = EasyRefreshController(
      controlFinishRefresh: true, controlFinishLoad: true);

  final HomeState state = HomeState();

  /// 下拉刷新
  void onRefresh() async {
    // _requestAppSort();
    refreshController.finishRefresh();
  }

  void onLoad() async {
    // _requestAppSort();
    Future.delayed(
      const Duration(seconds: 2),
      () {
        refreshController.finishLoad(IndicatorResult.noMore);
      },
    );
  }
}
